#include "graphicsview.h"
#include <QPixmap>
#include <QDebug>
#include <QGraphicsPixmapItem>
#include <QGraphicsScene>
GraphicsView::GraphicsView(QWidget * parent) :
  QGraphicsView(parent) {
  setScene(new QGraphicsScene(this));
}

void GraphicsView::resizeEvent(QResizeEvent * ) {
  fitInView(scene()->itemsBoundingRect(),Qt::KeepAspectRatio);
}

void GraphicsView::showImage(QImage img) {
  QGraphicsPixmapItem * item = scene()->addPixmap(QPixmap::fromImage(img));
  item->setTransformationMode(Qt::SmoothTransformation);

}
